package com.xyd.Biz.Impl;

import com.xyd.Biz.ProductClassBiz;
import com.xyd.Dao.ProductClassMapper;
import com.xyd.Entity.Commodity;
import com.xyd.Util.SqlSessionFactoryUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class ProductClassBizImpl implements ProductClassBiz {
        ProductClassMapper productClassMapper = null;

    public ProductClassBizImpl(){
        SqlSession session = SqlSessionFactoryUtil.open();
        productClassMapper = session.getMapper(ProductClassMapper.class);
    }

    @Override
    public List<Commodity> getCommodityNameAndCommonId() {
        return productClassMapper.getCommodityNameAndCommonId();
    }

    @Override
    public Commodity getCommodityById(int commodity_id) {
        return productClassMapper.getCommodityById(commodity_id);
    }

    @Override
    public List<Commodity> getCommodityByCommonId(int CommonId,int start) {
        return productClassMapper.getCommodityByCommonId(CommonId,start);
    }

    @Override
    public int countgetCommodityByCommonId(int CommonId) {
        return productClassMapper.countgetCommodityByCommonId(CommonId);
    }
}
